package com.jlhlyby.other;
/**
 *                /\
 *               /__\
 *              /\  /\
 *             /__\/__\
 *            /\      /\
 *           /__\    /__\
 *          /\  /\  /\  /\
 *         /__\/__\/__\/__\
 *        /\              /\
 *       /__\            /__\
 *      /\  /\          /\  /\
 *     /__\/__\        /__\/__\
 *    /\      /\      /\      /\
 *   /__\    /__\    /__\    /__\
 *  /\  /\  /\  /\  /\  /\  /\  /\
 * /__\/__\/__\/__\/__\/__\/__\/__\
 *
 * 1942题
 */
public class Obj1942 {
    public static void main(String[] args) {
        int n = 4;
        char[][] s = getEmptyArray(1<<n,1<<(n+1));
        onDraw(s,n,0,0);
        printArray(s);
    }
    public static void onDraw(char[][] arrays,int depth,int sRow, int sColumn){
        System.out.println(""+depth+" "+sRow+" "+sColumn);
        if (depth == 1){
            drawArray(arrays,sRow,sColumn);
        }else{
            onDraw(arrays,depth-1,sRow,sColumn+(1<<(depth-1)));
            onDraw(arrays,depth-1,sRow+(1<<(depth-1)),sColumn);
            onDraw(arrays,depth-1,sRow+(1<<(depth-1)),sColumn+(1<<depth));
        }
    }

    public static char[][] getEmptyArray(int row, int column) {
        char[][] arrays = new char[row][column];
        for (int i = 0; i < row; i++) {
            for (int j = 0; j < column; j++) {
                arrays[i][j] = ' ';
            }
        }
        return arrays;
    }

    public static  void printArray(char[][] arrays) {
        for (int i = 0; i < arrays.length; i++) {
            for (int j = 0; j < arrays[i].length; j++) {
                System.out.printf(String.valueOf(arrays[i][j]));
            }
            System.out.printf("\n");
        }
    }

    public static void drawArray(char[][] arrays, int sRow, int sColumn) {
        arrays[sRow][sColumn + 1] = '/';
        arrays[sRow][sColumn + 2] = '\\';
        arrays[sRow + 1][sColumn] = '/';
        arrays[sRow + 1][sColumn + 1] = '_';
        arrays[sRow + 1][sColumn + 2] = '_';
        arrays[sRow + 1][sColumn + 3] = '\\';
    }
}
